import { requestHttp } from "@/utils/request";

export interface EvalRole {
  id?: number;
  formKey?: string;
  name?: string;
  linkItemList?: string[];
  createTime?: string;
  updateTime?: string;
}

/**
 * 获取测评角色列表
 */
export function listEvalRole(params: EvalRole) {
  return requestHttp.get<EvalRole[]>("/form/eval/role/list", params);
}

/**
 * 获取测评角色详情
 * @param id
 */
export function getEvalRole(id: number | undefined): any {
  return requestHttp.get<EvalRole>(`/form/eval/role/${id}`);
}

/**
 * 创建测评角色
 * @param data
 */
export function addEvalRole(data: any) {
  return requestHttp.post("/form/eval/role/add", data);
}

/**
 * 修改测评角色
 * @param data
 */
export function updateEvalRole(data: any) {
  return requestHttp.post<EvalRole>("/form/eval/role/update", data);
}

/**
 * 删除测评角色
 * @param id
 */
export function delEvalRole(id: number | undefined) {
  return requestHttp.post(`/form/eval/role/delete/${id}`);
}
